package cn.krui.helper.tools;

import org.apache.poi.ss.usermodel.CellStyle;

/**
 * @author zc
 */
public class ExcelColumn {
  private int colSpan;
  
  private int rowSpan;
  
  private String field;
  
  private String title;
  
  private CellStyle headerStyle;
  
  private String headerStyleName;
  
  private IExcelCellStyleHandler cellStyleHandler;
  
  private String cellStyleName;
  
  private String dataFormat;
  
  private int[] width;
  
  private boolean autoSize;
  
  private IExcelCellFormatter cellFormatter;
  
  public ExcelColumn(String field, String title, int colSpan, int rowSpan) {
    this.autoSize = false;
    this.field = field;
    this.title = title;
    this.colSpan = colSpan;
    this.rowSpan = rowSpan;
  }
  
  public ExcelColumn(String field, String title) {
    this(field, title, 1, 1);
  }
  
  public ExcelColumn(String field, String title, int[] widths) {
    this(field, title);
    this.width = widths;
  }
  
  public ExcelColumn(String field, String title, boolean autoSize) {
    this(field, title);
    this.autoSize = autoSize;
  }
  
  public ExcelColumn(String field, String title, String dataFormat) {
    this(field, title);
    this.dataFormat = dataFormat;
  }
  
  public ExcelColumn(String field, String title, String dataFormat, int[] widths) {
    this(field, title, dataFormat);
    this.width = widths;
  }
  
  public ExcelColumn(String field, String title, String dataFormat, CellStyle headerStyle, IExcelCellStyleHandler cellStyleHandler, IExcelCellFormatter cellFormatter) {
    this(field, title, dataFormat, 1, 1, headerStyle, cellStyleHandler, cellFormatter, (int[])null, false);
  }
  
  public ExcelColumn(String field, String title, String dataFormat, String headerStyleName, String cellStyleName, IExcelCellFormatter cellFormatter) {
    this(field, title, dataFormat, 1, 1, headerStyleName, cellStyleName, cellFormatter, (int[])null, false);
  }
  
  public ExcelColumn(String field, String title, String dataFormat, int colSpan, int rowSpan, CellStyle headerStyle, IExcelCellStyleHandler cellStyleHandler, IExcelCellFormatter cellFormatter, int[] widths, boolean autoSize) {
    this.autoSize = false;
    this.field = field;
    this.title = title;
    this.colSpan = colSpan;
    this.rowSpan = rowSpan;
    this.dataFormat = dataFormat;
    this.headerStyle = headerStyle;
    this.cellStyleHandler = cellStyleHandler;
    this.cellFormatter = cellFormatter;
    this.width = widths;
    this.autoSize = autoSize;
  }
  
  public ExcelColumn(String field, String title, String dataFormat, int colSpan, int rowSpan, String headerStyleName, String cellStyleName, IExcelCellFormatter cellFormatter, int[] widths, boolean autoSize) {
    this.autoSize = false;
    this.field = field;
    this.title = title;
    this.colSpan = colSpan;
    this.rowSpan = rowSpan;
    this.headerStyleName = headerStyleName;
    this.cellStyleName = cellStyleName;
    this.cellFormatter = cellFormatter;
    this.width = widths;
    this.autoSize = autoSize;
  }
  
  public String getField() {
    return this.field;
  }
  
  public void setField(String field) {
    this.field = field;
  }
  
  public String getTitle() {
    return this.title;
  }
  
  public void setTitle(String title) {
    this.title = title;
  }
  
  public int getColSpan() {
    return this.colSpan;
  }
  
  public void setColSpan(int colSpan) {
    this.colSpan = colSpan;
  }
  
  public int getRowSpan() {
    return this.rowSpan;
  }
  
  public void setRowSpan(int rowSpan) {
    this.rowSpan = rowSpan;
  }
  
  public CellStyle getHeaderStyle() {
    return this.headerStyle;
  }
  
  public void setHeaderStyle(CellStyle headerStyle) {
    this.headerStyle = headerStyle;
  }
  
  public IExcelCellStyleHandler getCellStyleHandler() {
    return this.cellStyleHandler;
  }
  
  public void setCellStyleHandler(IExcelCellStyleHandler cellStyleHandler) {
    this.cellStyleHandler = cellStyleHandler;
  }
  
  public int[] getWidth() {
    return this.width;
  }
  
  public void setWidth(int[] width) {
    this.width = width;
  }
  
  public IExcelCellFormatter getCellFormatter() {
    return this.cellFormatter;
  }
  
  public void setCellFormatter(IExcelCellFormatter cellFormatter) {
    this.cellFormatter = cellFormatter;
  }
  
  public String getHeaderStyleName() {
    return this.headerStyleName;
  }
  
  public void setHeaderStyleName(String headerStyleName) {
    this.headerStyleName = headerStyleName;
  }
  
  public String getCellStyleName() {
    return this.cellStyleName;
  }
  
  public void setCellStyleName(String cellStyleName) {
    this.cellStyleName = cellStyleName;
  }
  
  public String getDataFormat() {
    return this.dataFormat;
  }
  
  public void setDataFormat(String dataFormat) {
    this.dataFormat = dataFormat;
  }
  
  public boolean isAutoSize() {
    return this.autoSize;
  }
  
  public void setAutoSize(boolean autoSize) {
    this.autoSize = autoSize;
  }
}
